﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HNG.LIB.Common;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using System.Web.UI.HtmlControls;
using System.Data;
public partial class Include_FadeSlideImage : System.Web.UI.UserControl
{
    TblBannerManager _TblBannersManager = new TblBannerManager();
    protected String str = String.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //GetBannerCenter
            TblBannerEntity _TblBannerEntity = new TblBannerEntity();
            _TblBannerEntity.LangId = HNG.LIB.Localization.LocalizationUtils.GetCurrentLanguage();
            _TblBannerEntity.SortExpression = TblBannerFields.ThuTu.Name;
            _TblBannerEntity.SortDirection = "ASC";
            _TblBannerEntity.Type = "slide";
            _TblBannerEntity.Status = "1";
            DataTable _dtSlide = _TblBannersManager.be_selectToGridView(_TblBannerEntity);
            str = "<script type='text/javascript'>";
            if (_dtSlide != null)
            {
                if (_dtSlide.Rows.Count > 0)
                    for (int i = 0; i < _dtSlide.Rows.Count; i++)
                    {
                        //str=fadeimages[i]=["Duong dan den anh ","Link anh ", ""]  
                        str += "fadeimages[" + i + "]=['" + ResolveUrl(_dtSlide.Rows[i]["Image"].ToString()) + "', '" + _dtSlide.Rows[i]["Url"].ToString() + "', ''];";
                    }
            }
            str += "new fadeshow(fadeimages, 950, 250, 0, 7000, 1, 'R');";
            str += "</script>";
            lblAnhQC.Text = str;

            LoadGioiThieu();
        }
    }

    private void LoadGioiThieu()
    {
        TblWebInfoEntity _TblWebInfoEntity = (TblWebInfoEntity)HNG.LIB.Securities.SecurityUtils.GetWebInfor();
        if (_TblWebInfoEntity != null)
        {
            if (!string.IsNullOrEmpty(_TblWebInfoEntity.Policy))
                lblIntroduretext.Text = _TblWebInfoEntity.Policy;
        }
    }
}